﻿using System;
using log4net;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ASPItalia.ModelVirtualCasting.Test
{
    [TestClass()]
    public class ExceptionLogWriterTest
    {
        private TestContext testContextInstance;

        public TestContext TestContext
        {
            get { return testContextInstance; }
            set { testContextInstance = value; }
        }

        [ClassInitialize()]
        public static void Initialize(TestContext testContext)
        {
            string methodName = "ExceptionLogWriterTest.Initialize";
            Exception exception = new Exception("This is a test!");
            ExceptionLogWriter.Write(methodName, exception);
        }

        [ClassCleanup()]
        public static void Cleanup()
        {
        }

        [TestInitialize()]
        public void TestInitialize()
        {
        }

        [TestCleanup()]
        public void TestCleanup()
        {
        }

        [TestMethod()]
        public void ExceptionLogEnabledTest()
        {
            bool actual = ExceptionLogWriter.ExceptionLogEnabled;
            Assert.IsTrue(actual);
        }

        [TestMethod()]
        public void ExceptionLoggerTest()
        {
            ILog actual = ExceptionLogWriter.ExceptionLogger;
            Assert.IsNotNull(actual);
            Assert.AreEqual("ExceptionLog", actual.Logger.Name);
        }
    }
}
